package com.example.workshop.lesson11;


import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ApplicationContext;

import java.util.Arrays;

@SpringBootApplication
class MovieRecommandSystemApplication {
	
	public static void main(String[] args) {
		//SpringApplication.run(MoviesRecommenderSystemApplication.class, args);
		
		
		//ApplicationContext负责管理Bean和依赖关系
		ApplicationContext appContext=SpringApplication.run(MovieRecommandSystemApplication.class, args);
		
		//创建RecommenderImplementation的实例化对象
		RecommenderImplementation recommender=appContext.getBean(RecommenderImplementation.class);
		System.out.println(recommender);

		//从Application Context中两次获得Prototype Bean
		System.out.println();
		Movie m1=appContext.getBean(Movie.class);
		System.out.println(m1);

		System.out.println();
		Movie m2=appContext.getBean(Movie.class);
		System.out.println(m2);


		System.out.println();

		
	}

}
